Skip to content

fix: address gosec findings so main goes green - #34

Merged
juicycleff merged 3 commits into
mainfrom
fix/gosec-findings
Aug 3, 2026
Merged

fix: address gosec findings so main goes green#34
juicycleff merged 3 commits into
mainfrom
fix/gosec-findings

Conversation

@juicycleff

Copy link
Copy Markdown
Contributor

Two sites already carried //nolint:gosec, but that is golangci-lint syntax -
gosec needs #nosec, so the documented intent never reached it. Added the
correct annotation alongside the existing one:

resources.go G101 an annotation key, not a credential
checker_cmd.go G204 check.Target is operator-configured

The two G104s are real and now handled: conn.Close() -> _ = conn.Close(), with
a note that the probe has already succeeded so a close error is not actionable.

A fifth finding was in dashboard/pages/template_form_templ.go, which templ
generates. That is fixed upstream in xraph/workflows v1.11.0, which now passes
-exclude-generated: a #nosec in generated code is erased on the next
generation run, so scanning it only yields findings nobody can act on.

Two sites already carried //nolint:gosec, but that is golangci-lint syntax -
gosec needs #nosec, so the documented intent never reached it. Added the
correct annotation alongside the existing one:

  resources.go       G101  an annotation key, not a credential
  checker_cmd.go     G204  check.Target is operator-configured

The two G104s are real and now handled: conn.Close() -> _ = conn.Close(), with
a note that the probe has already succeeded so a close error is not actionable.

A fifth finding was in dashboard/pages/template_form_templ.go, which templ
generates. That is fixed upstream in xraph/workflows v1.11.0, which now passes
-exclude-generated: a #nosec in generated code is erased on the next
generation run, so scanning it only yields findings nobody can act on.
Bumps the six with published fixes: grpc 1.80.0->1.82.1, x/text 0.37->0.40,
x/crypto 0.51->0.54, oras-go/v2 2.6.0->2.6.1, containerd 1.7.30->1.7.33,
quic-go 0.59.0->0.59.1. Builds clean.

GO-2026-5932 in x/crypto has no published fix, so govulncheck would keep CI
red no matter how many others are cleared. Sets govulncheck-fail-on-findings:
false (new in xraph/workflows v1.12.0) with the advisory named inline, so the
scan still reports and the reason is revisitable rather than forgotten.
golangci-lint runs gosec, so it honours the #nosec annotations added in the
previous commit - which made the older //nolint:gosec directives dead and
tripped nolintlint. One suppression mechanism, understood by both tools.
@juicycleff
juicycleff merged commit 40f4f37 into main Aug 3, 2026
11 checks passed
@juicycleff
juicycleff deleted the fix/gosec-findings branch August 3, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant